home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / dskut / ana015.zip / ANA.DOC next >
Text File  |  1990-09-17  |  16KB  |  351 lines

  1.  
  2.  
  3. I had developed an utility that had been extremely useful in my last few years
  4. as a software developer. I would like to share it with you now. However I don't
  5. know a good way to distribute binaries. I have include here a user guide and if
  6. any of you are interested, let me know how to send it to you.
  7.  
  8. ANA Command summary
  9. Prepared by: Paul C. Tam
  10. For Version 0.15
  11. Published on 24 July 1990
  12.  
  13.     I was rushing to finish this document, some parts may be confusing. I
  14.     appreciate any comment or enhancement of this document. This version of
  15.     ANA are free, please feel free to copy.
  16.  
  17. 0   HIGHLIGHTS
  18.  
  19.     * Interpret binary data in structures YOU defined.
  20.     * Rearrange data bytes before interpretation.
  21.     * Report current machine data types.
  22.     * Dump binary data in very flexible format.
  23.     * Dump multiple files in same screen.
  24.     * Same user interface across various platforms.
  25.     * Built in calculator/converter.
  26.     * Save output to disk to future use.
  27.     * Search for patterns.
  28.     * Execute Operating System command with exit utility.
  29.     * And more......
  30.  
  31.  
  32. 1   INTER-OPERABILITY
  33.  
  34.     Inter-operational seems to be a hot buzzword these days. This software will
  35.     do just that. Since the software is extremely portable, there are versions
  36.     running on almost any operating system that has a C compiler. They have
  37.     exactly the same look and feel across all platforms.
  38.  
  39. 2   Introduction
  40.  
  41.      ANA is an utility program to assist users (especailly software developer)
  42. who are interested in ANAlyzing the binary contents of any file. This program
  43. may be easier for users who know C since the terminology used here is C like.
  44.      Its major function is primarily to display the hexadecimal contents of any
  45. file interactively. On top of it, there are a lot of features built in to make
  46. this utility more flexible and useful. Some of these features include: able to
  47. dump the display buffer into a file, set the display length and base, pack the
  48. display and search for combination of bytes (search has not yet been built).
  49.      An unique feature of this utility is perhaps its ability to analyze
  50. certain structure. This feature is especially geared for software developers.
  51. Sometimes data files are an array of records, each record contains information
  52. of different types. For example, the data file maybe a control file of a print
  53. queue. There are a number of records in there to represent the number of files
  54. waiting to be printed. Each record in turns contains different fields, these
  55. fields may indicate the file name to be printed, its priority and so on. They
  56. may have data type of character (1 byte), integer (2 or 4 bytes) and ASCII
  57. string.
  58.      Using ANA, user can create an ASCII file in which the structure is defined.
  59. ANA then maps the data file into the structure and intreprets them as a series
  60. of fields instead of a string of bytes.
  61.  
  62. 3    How to invoke ANA
  63.  
  64.      ANA can be invoked in any one of the following ways:
  65.  
  66.      1) ANA
  67.      2) ANA <data_file_name>
  68.      3) ANA <data_file_name> <start_address> <length_of_buffer>
  69.  
  70. 4    Inputs
  71.  
  72.      Inputs can be of form hexidecimal, decimal or ascii. Numerical inputs are
  73.      interpreted according to the default base, however they can be overridden
  74.      by a prefix. Any input prefixed by 0x are always hex no matter what the
  75.      current default state is and any input prefixed with \ are always decimal.
  76.      Single ascii character must be between single quotes, ascii string,
  77.      however, must be between a pair of delimitor which can be any characters.
  78.      e.g. command s strings is the same as command s 'tring', they both search
  79.      for "tring".
  80.  
  81. 5    Report
  82.  
  83.      Unpacked -
  84.  0x00000000: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F |................|
  85.  0x00000010: 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F |................|
  86.  
  87.      Packed -
  88.  000102030405060708090A0B0C0D0E0F
  89.  101112131415161718191A1B1C1D1E1F
  90.  
  91.      The report format is fairly flexible. Report address, report data can be in
  92. either hexadecimal or decimal. The above format can vary depends on a
  93. number of parameters, these parameters can be set by various commands. However,
  94. the following are the default parameters unless otherwise overridden by their
  95. corresponding commands.
  96.  
  97.      Parameters     Defaults       Commands
  98.      Pack Mode      Unpacked       p (packed)
  99.      Address Base   Hexadecimal    b a (base)
  100.      Data Base        Hexadecimal       b d 
  101.      Buffer size    240 bytes      l (length)
  102.      Report width   16 bytes       w (width)
  103.      Start address  0              a (address)
  104.  
  105.  
  106. 6    Command Descriptions
  107.  
  108.      6.1  ? - Help
  109.           Display a brief description of commands available. This is useful for
  110.           commands review.
  111.  
  112.      6.2  ENTER - Display next buffer
  113.           Data is read from file into the data buffer and displayed. Then the
  114.           next starting address is updated so that the next ENTER will display
  115.           the following data.
  116.  
  117.      6.3  l - Set new buffer length
  118.           Define the size of the data buffer on the next display.
  119.  
  120.      6.4  a - Set new starting address
  121.           Define a new starting address of the data file rather than the
  122.           continuation of the last display buffer.
  123.  
  124.      6.5.1  b a - Toggle report address base
  125.           In the unpack mode, the address of the first byte of each report line
  126.           is shown. This address can be of base hexadecimal or decimal. This
  127.           command toggle the base.
  128.  
  129.      6.5.2  b d - Toggle report data base
  130.           Data reported can be of base hexadecimal or decimal. This command
  131.       toggle the base.
  132.  
  133.      6.5.3  b i - Toggle input base
  134.           All numerical inputs are interpreted on the current default base, this
  135.       command toggle the base. However, inputs prefixed with 0x are always 
  136.       interpreted as hex and inputs prefixed with \ are always decimal.
  137.  
  138.      6.6  c - Calculator functions
  139.           Sometimes it is necessary to do some arithmatic operations on the data
  140.           displayed. A simple set of arithmatic functions are available in ANA.
  141.           Currently, the calculator can only do integer arithmatic and is
  142.           limited to two operands and one operator (with only one exception for
  143.           conversion). The syntax of this command is the command keyword
  144.           followed by the operation followed by an ENTER. The following are
  145.           examples and descriptions of all available operations. Suppose X and
  146.           Y are two integers.
  147.  
  148.                c X * Y   ( X multiply Y )
  149.                c X / Y   ( X divided by Y )
  150.                c X + Y   ( X plus Y )
  151.                c X - Y   ( X minus Y )
  152.                c X % Y   ( reminder of X divided by Y )
  153.                c X & Y   ( X bit and with Y )
  154.                c X | Y   ( X bit or with Y )
  155.                c X ^ Y   ( X bit xor with Y )
  156.                c X > Y   ( X right shift Y bits )
  157.                c X < Y   ( X left shift Y bits )
  158.                c X       ( X can be hex, decimal or ASCII )
  159.  
  160.  
  161.      6.7  d - Download structure description file
  162.           Each structure description file maps only one structure, sometimes it
  163.           is desirable to map data to a different structure. This command loads
  164.           another descritpion file for the next mapping.
  165.      6.8  D - continuously dump
  166.       The whole work file starting at current location will be displayed 
  167.       continuously until the end of the file.
  168.  
  169.      6.9  i - information desk
  170.       This command display valuable information. Information includes the
  171.           data types in bytes of current machine, current work file name,
  172.           number, size, maximum work file allowed to open, number of work file
  173.           currently opened and the user input base, report data base and report
  174.           address base. Also the mapping alignments (read m command).
  175.  
  176.      6.10 m - Map data to structure
  177.           Maps the data in the data buffer just displayed into the structure
  178.           described by the SDF. Mapping currently starts at the beginning of
  179.           the data buffer, therefore